package bean;

/**
 * @author lyy
 * @date 2021/12/21
 */
public class Student implements Comparable<Student>{
    private String name;
    private Integer age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public static Student build(){
        Student student = new Student();
        student.setAge(0);
        student.setName("默认");
        return student;
    }

    public Student() {
    }

    public Student(Integer age) {
        this.age = age;
    }

    public Student(Integer age,String name) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public int compareTo(Student o) {
        return this.name.compareTo(o.getName());
    }
}
